function supports_input_type(str){
 	var i=document.createElement("input");
	i.setAttribute("type",str);
	return i.type !="text";
	///such as: color\email\number\range\search\tel\url\date\time\datetime\datetime-local\month\week
}
function result_textarea_test(para){
	var result="";
	var i=document.createElement('textarea');
	if(para in i)
		return true;
	else
		return false;
}
function result_select_test(para){
	var result="";
	var i=document.createElement('select');
	if(para in i)
		return true;
	else
		return false;
}
function result_fieldset_test(para){
	var result="";
	var i=document.createElement('fieldset');
	if(para in i)
		return true;
	else
		return false;
}
function result_datalist_test(para){
	var result="";
	var i=document.createElement('input');
	if(para in i)
		return true;
	else
		return false;
}
function result_keygen_test(para){
 	var result="";
	var i=document.createElement('keygen');
	if(para in i)
		return true;
	else
		return false;
}
function result_output_test(para){
	var result="";
	var i=document.createElement('output');
	if(para in i)
		return true;
	else
		return false;
}
function result_progress_test(para){
	var result="";
	var i=document.createElement('progress');
	if(para in i)
		return true;
	else
		return false;
}
function result_meter_test(para){
	var result="";
	var i=document.createElement('meter');
	if(para in i)
		return true;
	else
		return false;
}
function result_field_vilidation_test(para){
	var result="";
	var i=document.createElement('input');
	if(para in i)
		return true;
	else
		return false;
}
function result_assocaition_test(para){
	var result="";
	var i=document.createElement('label');
	result+="Association of controls and forms:"+"<br/>";
	result+="control property on labels:"+(('control' in i)?" yes":" no")+"<br/>";
	///////IE实现了form的部分功能，所以不能简单判断是否有form属性
		var element = document.createElement('div');
		document.body.appendChild(element);
		element.innerHTML = '<form id="fom"></form><input form="fom">';		
 		var tmp=element.lastChild.form == element.firstChild;
 		document.body.removeChild(element);
 	result+="form property on fields:"+(tmp?" yes":" no")+"<br/>";
 	i=document.createElement('input');
	if(para in i)
		return true;
	else
		return false;
}
function result_other_attributes_test(para){
	var result="";
	var i=document.createElement('input');
	if(para in i)
		return true;
	else
		return false;
}
function result_event_test(para){
	var result="";
	var i=document.createElement('form');
	i.setAttribute(para, ' ');
	if((typeof i.oninput =="function")||(typeof i.onchange =="function")||(typeof i.oninvalid =="function"))
		return true;
	else
		return false;
} 
function result_form_validation_test(para){
	var result="";
	var i=document.createElement('form');
	if((typeof i.checkValidity =="function")||(para in i))
		return true;
	else
		return false;
}
function result_text_tests(result) {
	result["form_input"] = {
		layerName:	"Input Type",
		type:"aggrg",
		nlist: {
			"search": supports_input_type("search"),
			"tel": supports_input_type("tel"),
			"url": supports_input_type("url"),
			"email": supports_input_type("email"),
			"datetime": supports_input_type("datetime"),
			"date": supports_input_type("date"),
			"month": supports_input_type("month"),
			"week": supports_input_type("week"),
			"time": supports_input_type("time"),
			"datetime-local": supports_input_type("datetime-local"),
			"number": supports_input_type("number"),
			"range": supports_input_type("range"),
			"color": supports_input_type("color"),
			"checkbox": supports_input_type("checkbox"),
			"image": supports_input_type("image")
		}
	};
	
	result["form_textarea"] = {
		layerName:	"Textarea",
		type:"aggrg",
		nlist: {
			"maxLength":result_textarea_test('maxLength'),
			"wrap":result_textarea_test('wrap')
		}
	};
	
	result["form_select"] = {
		layerName:	"Select",
		type:"aggrg",
		nlist: {
			"required":result_select_test('required')
		}
	};
	
	result["form_fieldset"] = {
		layerName:	"Fieldset",
		type:"aggrg",
		nlist: {
			"elements":result_fieldset_test('elements'),
			"disabled":result_fieldset_test('disabled')
		}
	};
	
	result["form_datalist"] = {
		layerName:	"Datalist",
		type:"aggrg",
		nlist: {
			"list":result_datalist_test('list')
		}
	};
	
	result["form_keygen"] = {
		layerName:	"Keygen",
		type:"aggrg",
		nlist: {
			"challenge":result_keygen_test('challenge'),
			"keytype":result_keygen_test('keytype')
		}
	};
	
	result["form_output"] = {
		layerName:	"Output",
		type:"aggrg",
		nlist: {
			"form":result_output_test('form')
		}
	};
	
	result["form_progress"] = {
		layerName:	"Progress",
		type:"aggrg",
		nlist: {
			"value":result_progress_test('value')
		}
	};
	
	result["form_meter"] = {
		layerName:	"Meter",
		type:"aggrg",
		nlist: {
			"value":result_meter_test('value')
		}
	};
	
	result["form_field_vilidation"] = {
		layerName:	"Field Vilidation",
		type:"aggrg",
		nlist: {
			"pattern":result_field_vilidation_test('pattern'),
			"required":result_field_vilidation_test('required')
		}
	};
	
	result["form_assocaition"] = {
		layerName:	"assocaition",
		type:"aggrg",
		nlist: {
			"formAction":result_assocaition_test('formAction'),
			"formEnctype":result_assocaition_test('formEnctype'),
			"formMethod":result_assocaition_test('formMethod'),
			"formNoValidate":result_assocaition_test('formNoValidate'),
			"formTarget":result_assocaition_test('formTarget'),
			"labels":result_assocaition_test('labels')
		}
	};
	
	result["form_other_attributes"] = {
		layerName:	"Other Attributes",
		type:"aggrg",
		nlist: {
			"autofocus":result_other_attributes_test('autofocus'),
			"autocomplete":result_other_attributes_test('autocomplete'),
			"placeholder":result_other_attributes_test('placeholder'),
			"multiple":result_other_attributes_test('multiple'),
			"dirname":result_other_attributes_test('dirname')
		}
	};
	result["form_event_attributes"] = {
		layerName:	"Event",
		type:"aggrg",
		nlist: {
			"oninput":result_event_test('oninput'),
			"onchange":result_event_test('onchange'),
			"oninvalid":result_event_test('oninvalid')
		}
	};
	
	result["form_form_validation_attributes"] = {
		layerName:	"Form Validation",
		type:"aggrg",
		nlist: {
			"checkValidity":result_form_validation_test('checkValidity'),
			"noValidate":result_form_validation_test('noValidate')
		}
	};
} 

function start_form_test(container){
	var E = {
		layerName: "CSS3 Form",
		type: "aggrg",
		nlist: {}
	};
	result_text_tests(E.nlist);
	return E;
}